/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package koneksi;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
/**
 *
 * @author rosi
 */
public class Koneksi {
    private String database = "convert";

    public static Connection open() throws SQLException, FileNotFoundException, IOException {
//        SettingFile set = new SettingFile();
//        String username = set.bacaUser();
//        String password = set.bacaPass();
//        String url = set.bacaUrl();
        Connection con = null;
        MysqlDataSource ds = new MysqlDataSource();
        ds.setURL("jdbc:mysql://localhost:3306/convert");
        ds.setUser("root");
        ds.setPassword("1234");
        con = ds.getConnection();
        return con;
    }

    public String getDatabase() {
        return "use " + database;
    }

}
